<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://www.ccut.edu.cn/saturn" prefix="saturn"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>templete jsp</title>
<%@ include file="/extjs/include/all.jsp"%>
</head>
<body>
<div id='gridDiv' style="widows: 100%"></div>
<script>
Ext.onReady(function(){
	var store = new Ext.data.JsonStore({
		url:'<%=request.getContextPath()%>/edu.ccut.saturn.manager.bundles.impl::/extComponentModule/tdValidateAction/QuerySaturnDataInfoByFullKey.action',
		root:'mapList',
		fields:[
			{name:'name',mapping:'name'},
			{name:'column',mapping:'column'},
			{name:'columnAlias',mapping:'columnAlias'},
			{name:'javaType',mapping:'javaType'}
		]
	});
	store.load({params:{
		fullKey:'<%=request.getParameter("fullKey")%>'
	}});
	var resultWidth = Ext.getBody().getWidth();
	var cm = new Ext.grid.ColumnModel([
		new Ext.grid.RowNumberer(),
		{header:'名称',dataIndex:'name',width:resultWidth*.20},
		{header:'列名',dataIndex:'column',width:resultWidth*.20},
		{header:'别名',dataIndex:'columnAlias',width:resultWidth*.20},
		{header:'JAVA类型',dataIndex:'javaType',width:resultWidth*.20},
		{header:'操作',dataIndex:'',renderer:function(value, p, record){
			return String.format("<a href=\"javascript:getValidates('<%=request.getParameter("fullKey")%>','{0}')\">验证</a>",
				record.data.name
			);
		}}
	]);
	
	var grid = new Ext.grid.GridPanel({
		el:'gridDiv',
		title:'详细信息',
		stripeRows: true,
	    collapsible:true,
	    trackMouseOver:false, 
	    bodyStyle:'width:100%',
	    loadMask: {msg:'正在加载数据，请稍侯……'}, 
	    autoHeight:true,
		store:store,
		cm:cm
	});
	grid.render();
});
</script>
<script type="text/javascript">
    function getValidates(fullKey,saturnItemName) {
        location = "<%=request.getContextPath()%>/edu.ccut.saturn.manager.bundles.impl::/componentModule/tdValidateAction/GetDataItemValidate.action?fullKey="+fullKey+"&saturnItemName="+saturnItemName;
    }
</script>
</body>
</html>